home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / mslang / proclc / clock.c next >
Encoding:
C/C++ Source or Header  |  1994-03-22  |  845 b   |  28 lines

  1. /***************************************************************
  2.         TINY CLOCK - TSR (RESIDENT) MODULE
  3.     Copyright (c) 1992-94 by Omega Point, Inc.
  4. ****************************************************************/
  5.  
  6. #include "cr.h"
  7.  
  8. char time_str[]="00:00:00";
  9.  
  10. popclock(void)
  11. {  register char *t,*s;
  12.    struct time_rec cur_time;
  13.  
  14.     add_tsc_event(6L);    /* Setup next event in 1/3 second */
  15.  
  16.     bios_time(&cur_time);    /* Read BIOS time of day */
  17.  
  18.     t=&cur_time.hours;    /* Prepare to convert hh:mm:ss */
  19.     s=time_str;
  20.     do cv_b2dec((byte)*t,s), s+=3;     /* Convert 1 byte to decimal */
  21.       while (--t>=&cur_time.seconds);  /* Until done with seconds */
  22.  
  23.     chk_video();          /* Obtain current video settings */
  24.     crs_x=scr_width-8;      /* Set cursor to upper right corner */
  25.     dsp(time_str);          /* Display time string there */
  26.  
  27. }
  28.